import Link from "next/link";
import { ArrowRight, Search } from "lucide-react";
import { getLocale } from "@/lib/i18n/server";
import { fmtDate, href, t } from "@/lib/i18n";
import { domainsWithCounts, graph, listPapers, stats } from "@/lib/papers/queries";
import { PaperCard, PaperRow } from "@/components/paper-items";
import { StatTiles } from "@/components/stat-tiles";
import { Constellation, type GEdge, type GNode } from "@/components/constellation";
export const revalidate = 300;
export default async function Home() {
const locale = await getLocale(); const d = t(locale);
const [s, featured, latest, domains, g] = await Promise.all([stats(), listPapers({ featured: true, sort: "recent", perPage: 4 }), listPapers({ sort: "revised", perPage: 6 }), domainsWithCounts(), graph(["topic", "method", "dataset", "author", "semantic", "curated"])]);
const featuredItems = [...featured.items].sort((a, b) => (a.featured_rank ?? 99) - (b.featured_rank ?? 99));
return (
<>
{d.site.secondary} · {d.site.affiliation} {d.home.heroLead} {d.site.tagline} {d.home.statsLead} {d.home.featuredLead} {d.home.latestLead} {d.home.domainsLead} {d.home.constellationLead}{d.home.heroTitle}
{d.home.stats}
{d.home.featured}
{d.home.latest}
{d.home.domains}
{domains.map((dm) =>
{d.home.constellation}
{d.stats.latest}: {s.latest ? fmtDate(locale, s.latest, "month") : "—"}
> ); }